package com.aspose.cells;

import java.util.HashMap;
import java.util.Iterator;

class zapl {
   private zapy a;
   private HashMap b;
   private double c;
   private Worksheet d;
   private zaqy e;
   private String f;
   private static final com.aspose.cells.b.c.a.za g = new com.aspose.cells.b.c.a.za(new String[]{"automatic-styles", "body", "legend-position", "x", "y", "width", "height", "style-name", "legend-expansion-aspect-ratio", "legend-expansion", "title", "legend", "plot-area", "table", "cell-range-address", "data-source-has-labels", "transform", "coordinate-region", "light", "axis", "series", "wall", "floor", "rotation-angle", "axis-label-position", "overlap", "gap-width", "minimum", "maximum", "interval-major", "interval-minor-divisor", "logarithmic", "reverse-direction", "dimension", "name", "primary-x", "primary-y", "secondary-x", "secondary-y", "grid", "categories", "p", "values-cell-range-address", "label-cell-address", "class", "attached-axis", "domain", "data-point", "repeated", "number-style", "style", "graphic-properties", "text-properties", "chart-properties", "font-size", "color", "font-family", "font-weight", "font-style", "text-line-through-style", "fill", "fill-color", "stroke", "stroke-dash", "stroke-color", "stroke-width", "stroke-opacity", "edge-rounding", "opacity", "vertical", "stacked", "percentage", "deep", "pie-offset", "symbol-type", "symbol-name", "symbol-width", "chartSysmbolHeight", "angle-offset", "three-dimensional", "right-angled-axes", "solid-type", "label-position", "data-label-number", "data-label-text", "data-label-symbol", "text-overlap", "display-label", "line-break", "link-data-style-to-source", "axis-position", "tick-mark-position", "none", "automatic", "named-symbol", "image", "chart:area", "chart:line", "chart:bar", "chart:circle", "chart:ring", "chart:scatter", "chart:radar", "chart:stock", "chart:bubble", "both", "column", "row"});

   zapl(zapy var1, Worksheet var2, zaqy var3) {
      this.a = var1;
      this.c = (double)var1.b.getWorksheets().M();
      this.b = new HashMap();
      this.d = var2;
      this.e = var3;
   }

   void a(zcfk var1) {
      Iterator var2 = var1.d_().j().iterator();

      while(var2.hasNext()) {
         zcfq var3 = (zcfq)var2.next();
         if (var3.e == 1) {
            switch(g.a(var3.g)) {
            case 0:
               this.c((zcfl)var3);
               break;
            case 1:
               this.a((zcfl)var3);
            }
         }
      }

   }

   private Chart a(Worksheet var1, zaqy var2, int var3) {
      int var4 = var1.getCharts().a(var3, var2.f, (int)var2.c, var2.g, (int)var2.b, (int)var2.d, (int)var2.e);
      Chart var5 = var1.getCharts().get(var4);
      return var5;
   }

   private void a(zcfl var1) {
      Iterator var2 = var1.j().iterator();

      while(var2.hasNext()) {
         zcfq var3 = (zcfq)var2.next();
         if (var3.e == 1) {
            zcfl var4 = (zcfl)var3;
            if ("chart".equals(var4.g)) {
               if ("office".equals(var4.f)) {
                  this.a(var4);
               } else if ("chart".equals(var4.f)) {
                  this.b(var4);
               }

               return;
            }
         }
      }

   }

   private void a(zcfl var1, Chart var2) {
      double var3 = 1.0D;
      boolean var5 = false;
      Iterator var6 = var1.e().iterator();

      while(var6.hasNext()) {
         zcfg var7 = (zcfg)var6.next();
         String var8 = var7.h;
         if (!zaqh.e(var8)) {
            switch(g.a(var7.g)) {
            case 2:
               var2.getLegend().setPosition(zaqh.b(var8));
               break;
            case 3:
               var2.getLegend().setX(a(var2, zaqh.c(this.c, var8)));
               break;
            case 4:
               var2.getLegend().setY(b(var2, zaqh.c(this.c, var8)));
               break;
            case 5:
               var2.getLegend().setWidth(a(var2, zaqh.c(this.c, var8)));
               break;
            case 6:
               var2.getLegend().setHeight(b(var2, zaqh.c(this.c, var8)));
               break;
            case 7:
               zapk var9 = (zapk)this.b.get(var8);
               if (var9 != null) {
                  if (var9.c != null) {
                     var2.getLegend().getFont().c(var9.j());
                  }

                  if (var9.n() != 0.0D) {
                     var2.getLegend().getBorder().setVisible(true);
                     var2.getLegend().getBorder().a(var9.b == null ? Color.getBlack() : zaqh.h(var9.b));
                  }
               }
               break;
            case 8:
               var3 = zase.B(var8);
               break;
            case 9:
               var5 = "custom".equals(var8);
            }
         }
      }

      var2.setShowLegend(true);
      if (var5 && var3 != 1.0D) {
         ;
      }

   }

   private void b(zcfl var1) {
      int var2 = 14;
      Iterator var3 = var1.e().iterator();

      while(var3.hasNext()) {
         zcfg var4 = (zcfg)var3.next();
         String var5 = var4.h;
         if ("class".equals(var4.g)) {
            var2 = zaqh.c(var5);
            break;
         }
      }

      Chart var8 = this.a(this.d, this.e, var2);
      var8.setShowLegend(false);
      if (var8.getType() != 65) {
         Iterator var9 = var1.e().iterator();

         while(var9.hasNext()) {
            zcfg var10 = (zcfg)var9.next();
            String var6 = var10.h;
            switch(g.a(var10.g)) {
            case 5:
               var8.getChartObject().setWidthCM(zaqh.b(this.c, var6));
               break;
            case 6:
               var8.getChartObject().setHeightCM(zaqh.b(this.c, var6));
               break;
            case 7:
               zapk var7 = (zapk)this.b.get(var6);
               if (var7.a != null) {
                  var8.getChartArea().getArea().setForegroundColor(zaqh.h(var7.a));
               } else {
                  var8.getChartArea().getArea().setForegroundColor(Color.getWhite());
               }
            }
         }

         var9 = var1.j().iterator();

         while(var9.hasNext()) {
            zcfq var11 = (zcfq)var9.next();
            if (var11.e == 1) {
               zcfl var12 = (zcfl)var11;
               switch(g.a(var12.g)) {
               case 10:
                  this.a(var12, var8.getTitle());
                  break;
               case 11:
                  this.a(var12, var8);
                  break;
               case 12:
                  this.b(var12, var8);
               case 13:
               }
            }
         }

      }
   }

   private static int a(Chart var0, double var1) {
      return (int)(var1 / var0.getChartObject().getWidthInch() * 4000.0D);
   }

   private static int b(Chart var0, double var1) {
      return (int)(var1 / var0.getChartObject().getHeightInch() * 4000.0D);
   }

   private void b(zcfl var1, Chart var2) {
      zapk var3 = null;
      String var4 = null;
      String var5 = null;
      Iterator var6 = var1.e().iterator();

      while(var6.hasNext()) {
         zcfg var7 = (zcfg)var6.next();
         String var8 = var7.h;
         switch(g.a(var7.g)) {
         case 3:
            var2.getPlotArea().setX(a(var2, zaqh.c(this.c, var8)));
            break;
         case 4:
            var2.getPlotArea().setY(b(var2, zaqh.c(this.c, var8)));
            break;
         case 5:
            var2.getPlotArea().setWidth(a(var2, zaqh.c(this.c, var8)));
            break;
         case 6:
            var2.getPlotArea().setHeight(b(var2, zaqh.c(this.c, var8)));
            break;
         case 7:
            var3 = (zapk)this.b.get(var8);
         case 8:
         case 9:
         case 10:
         case 11:
         case 12:
         case 13:
         default:
            break;
         case 14:
            var4 = this.a(var8);
            break;
         case 15:
            var5 = var8;
            break;
         case 16:
            var2.getPlotArea().a(var8);
         }
      }

      if (var3 != null) {
         if (var3.k()) {
            switch(var2.getType()) {
            case 0:
               var2.setType(3);
               break;
            case 14:
               if (var3.a()) {
                  var2.setType(9);
               } else {
                  var2.setType(18);
               }
               break;
            case 37:
               var2.setType(43);
               break;
            case 44:
               var2.setType(45);
            }
         }

         var2.setRightAngleAxes(var3.l());
      }

      int var13 = -1;
      String[] var14 = null;

      try {
         var14 = this.a(var4, var5);
      } catch (Exception var12) {
         ;
      }

      Iterator var15 = var1.j().iterator();

      while(var15.hasNext()) {
         zcfq var9 = (zcfq)var15.next();
         if (var9.e == 1) {
            zcfl var10 = (zcfl)var9;
            switch(g.a(var10.g)) {
            case 17:
            case 18:
            case 22:
            default:
               break;
            case 19:
               this.d(var10, var2);
               break;
            case 20:
               WorksheetCollection var10002 = this.a.b.getWorksheets();
               SeriesCollection var10003 = var2.getNSeries();
               ++var13;
               Series var11 = new Series(var10002, var10003, var13);
               var2.getNSeries().a(var11);
               this.a(var10, var2, var11, var13, var3, var14);
               break;
            case 21:
               this.c(var10, var2);
            }
         }
      }

      if (!zaqh.e(this.f) && !this.c(this.f)) {
         var2.getNSeries().setCategoryData(this.a(this.f));
      }

      var2.setPlotVisibleCells(false);
   }

   private void c(zcfl var1, Chart var2) {
      String var3 = var1.a("style-name", (String)null);
      if (!zaqh.e(var3)) {
         zapk var4 = (zapk)this.b.get(var3);
         if (var2.getIs3D()) {
            if (var4.a != null && !"none".equals(var4.g())) {
               var2.getWalls().setForegroundColor(zaqh.h(var4.a));
            } else {
               var2.getWalls().setForegroundColor(Color.getWhite());
            }

            if (var4.b != null) {
               var2.getWalls().getBorder().a(zaqh.h(var4.b));
            }
         } else {
            if (var4.a != null && !"none".equals(var4.g())) {
               var2.getPlotArea().getArea().setForegroundColor(zaqh.h(var4.a));
            } else {
               var2.getPlotArea().getArea().setForegroundColor(Color.getWhite());
            }

            if (var4.b != null) {
               var2.getPlotArea().getBorder().a(zaqh.h(var4.b));
            }
         }
      }

   }

   private void a(Axis var1, zapk var2, boolean var3, boolean var4) {
      Chart var5 = var1.a();
      if (var2.b != null) {
         var1.getAxisLine().a(zaqh.h(var2.b));
      }

      var1.getAxisLine().c(var2.h());
      if (var2.c != null) {
         var1.getTickLabels().getFont().c(var2.j());
      }

      int var6 = 150;
      int var7 = 0;
      Iterator var8 = var2.d.keySet().iterator();

      while(var8.hasNext()) {
         String var9 = (String)var8.next();
         String var10 = (String)var2.d.get(var9);
         switch(g.a(var9)) {
         case 23:
            var1.getTickLabels().setRotationAngle(zaqh.i(var10));
            break;
         case 24:
            var1.setTickLabelPosition(zaqh.x(var10));
            break;
         case 25:
            var7 = zaqh.o(var10);
            break;
         case 26:
            var6 = zaqh.o(var10);
            break;
         case 27:
            var1.setMinValue(zaqh.n(var10));
            break;
         case 28:
            var1.setMaxValue(zaqh.n(var10));
            break;
         case 29:
            var1.setMajorUnit(zaqh.n(var10));
            break;
         case 30:
            var1.setMinorUnit(zaqh.n(var10));
            break;
         case 31:
            var1.setLogarithmic(zaqh.m(var10));
            break;
         case 32:
            var1.setPlotOrderReversed(zaqh.m(var10));
         }
      }

      if (var3 && (var6 != 150 || var7 != 0)) {
         var8 = var5.c.iterator();

         while(var8.hasNext()) {
            ziz var11 = (ziz)var8.next();
            if (var4 == !var11.m()) {
               var11.e(var7);
               var11.c(var6);
            }
         }
      }

   }

   private void d(zcfl var1, Chart var2) {
      Object var3 = null;
      String var4 = null;
      zapk var5 = null;
      Iterator var6 = var1.e().iterator();

      while(var6.hasNext()) {
         zcfg var7 = (zcfg)var6.next();
         String var8 = var7.h;
         switch(g.a(var7.g)) {
         case 7:
            var5 = (zapk)this.b.get(var8);
         case 33:
            break;
         case 34:
            var4 = var8;
         }
      }

      Axis var10 = null;
      switch(g.a(var4)) {
      case 35:
         var10 = var2.getCategoryAxis();
         this.a(var2.getCategoryAxis(), var5, false, true);
         break;
      case 36:
         var10 = var2.getValueAxis();
         this.a(var2.getValueAxis(), var5, true, true);
         break;
      case 37:
         var10 = var2.getCategoryAxis();
         var10.setVisible(true);
         this.a(var10, var5, false, false);
         break;
      case 38:
         var10 = var2.getSecondValueAxis();
         var10.setVisible(true);
         this.a(var10, var5, true, false);
      }

      Iterator var11 = var1.j().iterator();

      while(var11.hasNext()) {
         zcfq var12 = (zcfq)var11.next();
         if (var12.e == 1) {
            zcfl var9 = (zcfl)var12;
            switch(g.a(var9.g)) {
            case 10:
               this.a(var9, var10.getTitle());
               break;
            case 39:
               this.a(var9, var10.getMajorGridLines());
               break;
            case 40:
               this.f = var9.a("cell-range-address", (String)null);
            }
         }
      }

   }

   private void a(zcfl var1, Line var2) {
      zapk var3 = null;
      Iterator var4 = var1.e().iterator();

      while(var4.hasNext()) {
         zcfg var5 = (zcfg)var4.next();
         String var6 = var5.h;
         switch(g.a(var5.g)) {
         case 7:
            var3 = (zapk)this.b.get(var6);
         }
      }

      if (var3 != null && var3.b != null) {
         var2.a(zaqh.h(var3.b));
      }

   }

   private void a(zcfl var1, Title var2) {
      Iterator var3 = var1.e().iterator();

      while(true) {
         zapk var6;
         label51:
         do {
            while(var3.hasNext()) {
               zcfg var4 = (zcfg)var3.next();
               String var5 = var4.h;
               switch(g.a(var4.g)) {
               case 3:
               case 4:
               case 5:
               case 6:
               default:
                  break;
               case 7:
                  var6 = (zapk)this.b.get(var5);
                  continue label51;
               }
            }

            var3 = var1.j().iterator();

            while(var3.hasNext()) {
               zcfq var10 = (zcfq)var3.next();
               if (var10.e == 1) {
                  zcfl var11 = (zcfl)var10;
                  switch(g.a(var11.g)) {
                  case 41:
                     var2.w = var11.a();
                  }
               }
            }

            return;
         } while(var6 == null);

         if (var6.c != null) {
            var2.getFont().c(var6.j());
         }

         Iterator var7 = var6.d.keySet().iterator();

         while(var7.hasNext()) {
            String var8 = (String)var7.next();
            String var9 = (String)var6.d.get(var8);
            switch(g.a(var8)) {
            case 23:
               var2.setRotationAngle(zaqh.i(var9));
            }
         }
      }
   }

   private void a(zcfl var1, Chart var2, Series var3, int var4, zapk var5, String[] var6) {
      zapk var7 = null;
      String var8 = null;
      String var9 = null;
      boolean var10 = false;
      Iterator var11 = var1.e().iterator();

      while(var11.hasNext()) {
         zcfg var12 = (zcfg)var11.next();
         String var13 = var12.h;
         switch(g.a(var12.g)) {
         case 7:
            var7 = (zapk)this.b.get(var13);
            break;
         case 42:
            var8 = this.a(var13);
            break;
         case 43:
            var3.a("=" + this.a(var13));
            break;
         case 44:
            var9 = var13;
            break;
         case 45:
            var10 = "secondary-y".equals(var13);
         }
      }

      int var17 = var2.getType();

      int var18;
      for(var18 = 0; var18 < var2.m().getCount(); ++var18) {
         if (var2.m().a(var18).j() == var17 && var10 == var2.m().a(var18).m()) {
            var3.a(var2.m().a(var18));
         }
      }

      if (var3.s() == null) {
         ziz var19 = new ziz(var2.m(), var17, var10);
         var2.m().a(var19);
         var3.a(var19);
      }

      if (var2.getType() != 36) {
         var17 = this.a(var2, var9, var5, var7, var5.k());
      }

      var3.setType(var17);
      if (var5.i() != null && !"90".equals(var5.i())) {
         try {
            var18 = com.aspose.cells.b.a.zo.a(var5.i());
            var18 = 90 - var18;
            if (var18 < 0) {
               var18 += 360;
            }

            var3.setFirstSliceAngle((short)var18);
         } catch (Exception var16) {
            ;
         }
      }

      if (var8 == null && var6 != null) {
         var8 = var6[var4];
      }

      var3.setValues(var8);
      if (var7 != null) {
         if (ChartCollection.s(var3.getType())) {
            if (var7.b != null) {
               var3.getMarker().a(zaqh.h(var7.b));
            }

            if (var7.a != null) {
               var3.getMarker().b(zaqh.h(var7.a));
            }

            if (var7.e() != 5) {
               var3.getMarker().setMarkerStyle(var7.e());
               if (var7.e() != 0 && var7.p() != 0.0D) {
                  var3.getMarker().setMarkerSize((int)zaqh.b(this.a.b.getWorksheets(), var7.p()));
               }
            }

            if (var7.q() != 0.0D) {
               var3.getMarker().getArea().setTransparency(1.0D - var7.q());
            }
         } else {
            if (var7.a != null) {
               var3.getArea().setForegroundColor(zaqh.h(var7.a));
            }

            if (var7.b != null) {
               var3.getBorder().a(zaqh.h(var7.b));
            }

            if (var7.h() != 6) {
               var3.getBorder().c(var7.h());
            }

            if (var7.n() != 0.0D) {
               var3.getBorder().c(var7.n());
            }
         }

         if (var7.r() != 8) {
            var3.getDataLabels().setPosition(var7.r());
         }

         var3.getDataLabels().setSeparatorValue(var7.v());
         if (var7.t()) {
            var3.getDataLabels().setShowLegendKey(true);
         }

         if (var7.u()) {
            var3.getDataLabels().setShowSeriesName(true);
         }

         if ("value-and-percentage".equals(var7.s())) {
            var3.getDataLabels().setShowValue(true);
            var3.getDataLabels().setShowPercentage(true);
         } else if ("value".equals(var7.s())) {
            var3.getDataLabels().setShowValue(true);
         } else if ("percentage".equals(var7.s())) {
            var3.getDataLabels().setShowPercentage(true);
         }
      }

      var18 = 0;
      Iterator var20 = var1.j().iterator();

      while(var20.hasNext()) {
         zcfq var14 = (zcfq)var20.next();
         if (var14.e != 1) {
            zcfl var15 = (zcfl)var14;
            switch(g.a(var15.g)) {
            case 46:
               break;
            case 47:
               var18 = this.a(var15, var2, var3, var18);
               break;
            default:
               ++var18;
            }
         }
      }

   }

   private int a(zcfl var1, Chart var2, Series var3, int var4) {
      zapk var5 = null;
      int var6 = 1;
      Iterator var7 = var1.e().iterator();

      while(var7.hasNext()) {
         zcfg var8 = (zcfg)var7.next();
         String var9 = var8.h;
         switch(g.a(var8.g)) {
         case 7:
            var5 = (zapk)this.b.get(var9);
            break;
         case 48:
            var6 = zaqh.o(var9);
         }
      }

      if (var5 == null) {
         return var4 + var6;
      } else {
         for(int var10 = 0; var10 < var6; ++var4) {
            ChartPoint var11 = var3.getPoints().get(var4);
            if (var2.getType() != 60 && var2.getType() != 37 && var2.getType() != 38 && var2.getType() != 39) {
               if (var5.a != null) {
                  var11.getArea().setForegroundColor(zaqh.h(var5.a));
               }
            } else {
               if (var5.b != null) {
                  var11.getMarker().a(zaqh.h(var5.b));
               }

               if (var5.a != null) {
                  var11.getMarker().b(zaqh.h(var5.a));
               }

               if (var5.e() != 5) {
                  var11.getMarker().setMarkerStyle(var5.e());
               }

               if (var5.p() != 0.0D) {
                  var11.getMarker().setMarkerSize((int)zaqh.b(this.a.b.getWorksheets(), var5.p()));
               }

               if (var5.q() != 0.0D) {
                  var11.getMarker().getArea().setTransparency(1.0D - var5.q());
               }
            }

            if (!zaqh.e(var5.d())) {
               var11.setExplosion(com.aspose.cells.b.a.zo.a(var5.d()));
            }

            if ("none".equals(var5.f())) {
               var11.getBorder().setVisible(false);
            }

            ++var10;
         }

         return var4;
      }
   }

   private void c(zcfl var1) {
      this.b.clear();
      Iterator var2 = var1.j().iterator();

      while(var2.hasNext()) {
         zcfq var3 = (zcfq)var2.next();
         if (var3.e == 1) {
            zcfl var4 = (zcfl)var3;
            switch(g.a(var4.g)) {
            case 49:
            default:
               break;
            case 50:
               this.d(var4);
            }
         }
      }

   }

   private void d(zcfl var1) {
      String var2 = var1.a("name", (String)null);
      zapk var3 = new zapk();
      this.b.put(var2, var3);
      Iterator var4 = var1.j().iterator();

      while(var4.hasNext()) {
         zcfq var5 = (zcfq)var4.next();
         if (var5.e == 1) {
            zcfl var6 = (zcfl)var5;
            switch(g.a(var6.g)) {
            case 51:
               this.b(var6, var3);
               break;
            case 52:
               this.a(var6, var3);
               break;
            case 53:
               this.c(var6, var3);
            }
         }
      }

   }

   private void a(zcfl var1, zapk var2) {
      var2.a(this.a.b.getWorksheets());
      Iterator var3 = var1.e().iterator();

      while(var3.hasNext()) {
         zcfg var4 = (zcfg)var3.next();
         String var5 = var4.h;
         switch(g.a(var4.g)) {
         case 54:
            var2.j().setDoubleSize(zaqh.d((double)this.a.b.getWorksheets().M(), var5));
            break;
         case 55:
            var2.j().setColor(zaqh.h(var5));
            break;
         case 56:
            var2.j().setName(var5);
            break;
         case 57:
            var2.j().setBold("bold".equals(var5.toLowerCase()));
            break;
         case 58:
            var2.j().setItalic("italic".equals(var5.toLowerCase()));
            break;
         case 59:
            var2.j().setStrikeout("solid".equals(var5.toLowerCase()));
         }
      }

   }

   private void b(zcfl var1, zapk var2) {
      Iterator var3 = var1.e().iterator();

      while(var3.hasNext()) {
         zcfg var4 = (zcfg)var3.next();
         String var5 = var4.h;
         switch(g.a(var4.g)) {
         case 60:
            var2.c(var5);
            break;
         case 61:
            var2.a = var5;
            break;
         case 62:
            var2.b(var5);
            break;
         case 63:
            var2.b(zaqh.j(var5));
            break;
         case 64:
            var2.b = var5;
            break;
         case 65:
            var2.a(zaqh.d(this.c, var5));
         case 66:
         case 67:
         default:
            break;
         case 68:
            if (var5.endsWith("%")) {
               var2.c(zaqh.n(var5.substring(0, 0 + (var5.length() - 1))) / 100.0D);
            }
         }
      }

   }

   private void c(zcfl var1, zapk var2) {
      Iterator var3 = var1.e().iterator();

      String var5;
      while(var3.hasNext()) {
         zcfg var4 = (zcfg)var3.next();
         var5 = var4.h;
         if (!zaqh.e(var5)) {
            switch(g.a(var4.g)) {
            case 23:
            case 24:
            case 25:
            case 26:
            case 27:
            case 28:
            case 29:
            case 30:
            case 31:
            case 32:
            case 33:
            case 34:
            case 35:
            case 36:
            case 37:
            case 38:
            case 39:
            case 40:
            case 41:
            case 42:
            case 43:
            case 44:
            case 45:
            case 46:
            case 47:
            case 48:
            case 49:
            case 50:
            case 51:
            case 52:
            case 53:
            case 54:
            case 55:
            case 56:
            case 57:
            case 58:
            case 59:
            case 60:
            case 61:
            case 62:
            case 63:
            case 64:
            case 65:
            case 66:
            case 67:
            case 68:
            case 86:
            case 87:
            case 88:
            case 89:
            case 90:
            case 91:
            default:
               var2.d.put(var4.g, var4.h);
               break;
            case 69:
               var2.a(zaqh.m(var4.h));
               break;
            case 70:
               var2.b(zaqh.m(var4.h));
               break;
            case 71:
               var2.c(zaqh.m(var4.h));
               break;
            case 72:
               var2.f(zaqh.m(var4.h));
               break;
            case 73:
               var2.a(var4.h);
               break;
            case 74:
               switch(g.a(var5)) {
               case 92:
                  var2.a(5);
                  continue;
               case 93:
                  var2.a(0);
               case 94:
               case 95:
               default:
                  continue;
               }
            case 75:
               var2.a(zaqh.a(var4.h));
               break;
            case 76:
               var2.b(zaqh.b(this.c, var4.h));
            case 77:
               break;
            case 78:
               var2.d(var4.h);
               break;
            case 79:
               var2.d(zaqh.m(var4.h));
               break;
            case 80:
               var2.e(zaqh.m(var4.h));
               break;
            case 81:
               var2.c(zaqh.d(var4.h));
               break;
            case 82:
               var2.d(zaqh.w(var4.h));
               break;
            case 83:
               var2.e(var4.h);
               break;
            case 84:
               var2.g(zaqh.m(var4.h));
               break;
            case 85:
               var2.h(zaqh.m(var4.h));
            }
         }
      }

      var3 = var1.j().iterator();

      while(var3.hasNext()) {
         zcfq var6 = (zcfq)var3.next();
         if ("label-separator".equals(var6.g)) {
            var5 = var6.a();
            if (!zaqh.e(var5)) {
               var2.f(var5);
            }
         }
      }

   }

   private int a(Chart var1, String var2, zapk var3, zapk var4, boolean var5) {
      if (var2 != null && !"".equals(var2)) {
         int var6 = var1.getType();
         String var7 = var2.toLowerCase();
         switch(g.a(var7)) {
         case 96:
            if (var5) {
               var6 = 3;
               if (var3.b()) {
                  var6 = 4;
               }

               if (var3.c()) {
                  var6 = 5;
               }
            } else {
               var6 = 0;
               if (var3.b()) {
                  var6 = 1;
               }

               if (var3.c()) {
                  var6 = 2;
               }
            }
            break;
         case 97:
            if (var3.b()) {
               var6 = 38;
            } else if (var3.c()) {
               var6 = 39;
            } else if (var5) {
               var6 = 43;
            } else {
               var6 = 37;
            }
            break;
         case 98:
            if (var5) {
               var6 = this.a(var3, var4, var1.getType());
            } else if (var3.a()) {
               var6 = 6;
               if (var3.b()) {
                  var6 = 7;
               }

               if (var3.c()) {
                  var6 = 8;
               }
            } else {
               var6 = 14;
               if (var3.b()) {
                  var6 = 15;
               }

               if (var3.c()) {
                  var6 = 16;
               }
            }
            break;
         case 99:
            if (var1.getType() == 35) {
               var6 = 35;
               if (!zaqh.e(var4.d())) {
                  var6 = 36;
               }
            } else if (var5) {
               var6 = 45;
               if (!zaqh.e(var4.d())) {
                  var6 = 48;
               }
            } else {
               var6 = 44;
               if (!zaqh.e(var4.d())) {
                  var6 = 47;
               }
            }
            break;
         case 100:
            var6 = 35;
            if (!zaqh.e(var4.d())) {
               var6 = 36;
            }
            break;
         case 101:
            var6 = 60;
            break;
         case 102:
            var6 = 57;
            break;
         case 103:
            var6 = 65;
            break;
         case 104:
            if (var5) {
               var6 = 13;
            } else {
               var6 = 12;
            }
            break;
         default:
            var6 = 14;
         }

         return var6;
      } else {
         return var1.getType();
      }
   }

   private int a(zapk var1, zapk var2, int var3) {
      int var4 = var3;
      switch(var2.m()) {
      case 0:
         if (var2.a()) {
            var4 = 9;
            if (var2.b()) {
               var4 = 10;
            }

            if (var2.c()) {
               var4 = 11;
            }
         } else {
            var4 = 18;
            if (var2.o()) {
               var4 = 17;
            }

            if (var2.b()) {
               var4 = 19;
            }

            if (var2.c()) {
               var4 = 20;
            }
         }
         break;
      case 1:
         if (var2.a()) {
            var4 = 53;
            if (var2.b()) {
               var4 = 54;
            }

            if (var2.c()) {
               var4 = 55;
            }
         } else {
            var4 = 50;
            if (var2.o()) {
               var4 = 56;
            }

            if (var2.b()) {
               var4 = 51;
            }

            if (var2.c()) {
               var4 = 52;
            }
         }
      case 2:
      case 5:
      default:
         break;
      case 3:
         if (var2.a()) {
            var4 = 31;
            if (var2.b()) {
               var4 = 32;
            }

            if (var2.c()) {
               var4 = 33;
            }
         } else {
            var4 = 28;
            if (var2.o()) {
               var4 = 34;
            }

            if (var2.b()) {
               var4 = 29;
            }

            if (var2.c()) {
               var4 = 30;
            }
         }
         break;
      case 4:
         if (var2.a()) {
            var4 = 24;
            if (var2.b()) {
               var4 = 25;
            }

            if (var2.c()) {
               var4 = 26;
            }
         } else {
            var4 = 21;
            if (var2.o()) {
               var4 = 27;
            }

            if (var2.b()) {
               var4 = 22;
            }

            if (var2.c()) {
               var4 = 23;
            }
         }
      }

      return var4;
   }

   private String a(String var1) {
      if (var1 != null && !"".equals(var1)) {
         if (var1.indexOf(":") < 0) {
            var1 = com.aspose.cells.b.a.zv.a(var1, ".", "!");
            return var1 + ":" + com.aspose.cells.b.a.zv.d(var1, '!')[1];
         } else {
            String[] var2 = null;
            if (var1.indexOf(" '") > -1) {
               var2 = var1.split(" '");
            } else if (var1.indexOf(":") == var1.lastIndexOf(":")) {
               var2 = new String[]{var1};
            } else {
               var2 = com.aspose.cells.b.a.zv.d(var1, ' ');
            }

            StringBuilder var3 = new StringBuilder();
            String var4 = "";

            for(int var5 = 0; var5 < var2.length; ++var5) {
               var3.append(var4);
               var3.append(this.b(var2[var5]));
               var4 = ",";
            }

            return com.aspose.cells.b.a.zr.a(com.aspose.cells.b.a.g.zf.a(var3, "'", ""));
         }
      } else {
         return var1;
      }
   }

   private String b(String var1) {
      String[] var2 = com.aspose.cells.b.a.zv.d(var1, ':');
      String var3 = var2[0];
      String var4 = var2[1];
      int var5 = var3.indexOf(".");
      if (var5 == var4.indexOf(".")) {
         var4 = var4.substring(var4.lastIndexOf(".") + 1);
      } else {
         var4 = var4.substring(1);
      }

      StringBuilder var6 = new StringBuilder(com.aspose.cells.b.a.zv.a(com.aspose.cells.b.a.zv.a(var3, ".", "!"), "$", ""));
      var6.append(":");
      var6.append(com.aspose.cells.b.a.zv.a(var4, "$", ""));
      return com.aspose.cells.b.a.zr.a(var6);
   }

   private boolean c(String var1) {
      boolean var2 = false;

      for(int var3 = 0; var3 < this.a.b.getWorksheets().getCount(); ++var3) {
         if (this.a.b.getWorksheets().get(var3).getName().indexOf("local-table") > -1) {
            var2 = true;
            break;
         }
      }

      return var1.indexOf("local-table") > -1 && !var2;
   }

   private String[] a(String var1, String var2) {
      if (var1.indexOf(32) != -1) {
         return null;
      } else {
         String[] var3 = null;
         if (!zaqh.e(var1)) {
            int var4 = var1.indexOf("!");
            int var5 = var1.indexOf(":");
            String var6 = var1.substring(0, 0 + var4 + 1);
            String var7 = var1.substring(var4 + 1, var4 + 1 + (var5 - var4 - 1));
            String var8 = var1.substring(var5 + 1);
            byte var9 = -1;
            byte var10 = -1;
            byte var11 = -1;
            byte var12 = -1;
            int[] var13 = new int[]{var9};
            int[] var14 = new int[]{var10};
            CellsHelper.a(var7, var13, var14);
            int var18 = var13[0];
            int var19 = var14[0];
            int[] var15 = new int[]{var11};
            int[] var16 = new int[]{var12};
            CellsHelper.a(var8, var15, var16);
            int var20 = var15[0];
            int var21 = var16[0];
            switch(g.a(var2)) {
            case 105:
               ++var18;
               ++var19;
               break;
            case 106:
               ++var19;
               break;
            case 107:
               ++var18;
            }

            var3 = new String[var20 - var18 + 1];

            for(int var17 = 0; var17 < var20 - var18 + 1; ++var17) {
               var3[var17] = var6 + CellsHelper.cellIndexToName(var18 + var17, var19) + ":" + CellsHelper.cellIndexToName(var18 + var17, var21);
            }
         }

         return var3;
      }
   }
}
